package com.tm.hutool.controller;

import com.tm.hutool.entity.OperationEntity;
import com.tm.hutool.service.OperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zyl
 * @create 2022-08-17 19:16
 */
@RestController
@RequestMapping

public class OperationController {
    @Autowired
    private OperationService operationService;

    @GetMapping("getById")
    public Object getById(Integer id){
        OperationEntity byId = operationService.getById(id);
        return byId;


    }
    @PostMapping("save")
    public void save(){
        OperationEntity operationEntity = new OperationEntity();

        operationEntity.setModuleName("李四");
        operationEntity.setOperationType("岗位管理");
        operationEntity.setOperator("新增岗位");
        //operationEntity.setCreateTime(System.currentTimeMillis());
        operationService.save(operationEntity);
        System.out.println(operationEntity);


    }
}
